package com.donquijote.test;

import com.doquijote.spring6.bean.User;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.text.SimpleDateFormat;

/**
 * @author 421527548@qq.com
 * @version V1.0
 * @title
 * @description
 * @date 2022-11-02 18:21
 */
public class SpringTest02 {

    @Test
    public void test01() {
        ApplicationContext context = new ClassPathXmlApplicationContext("spring.xml");

        User userBean = context.getBean("userBean", User.class);


        System.out.println(userBean);
        Object timeBean = context.getBean("timeBean");
        System.out.println(timeBean);

    }

    @Test
    public void test02() {
        Logger logger = LoggerFactory.getLogger(SpringTest02.class);
        logger.info("我是一条消息");
        logger.debug("debug消息");
        logger.error("一条错误消息");
    }


}
